<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        body{
            height:3000px;
        }
    </style>
</head>
<body>

<script>
  function throttle(fn,delay){
      let lastTime = 0;
      return function(){
          let nowTime = Date.now()
          if(nowTime - lastTime > delay){
              fn()
              lastTime = nowTime
          }
      }
  }
  document.onscroll = throttle(function(){
      console.log(Date.now())
  },1000)
</script>
</body>
</html>
